<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>自定义表明细</title>
        <#include "/pubHeadStyle.html">
        <link rel="stylesheet" href="${ctx}/css/form.css">
    </head>
    <body>
        <form action="" class="layui-form" style="height: 100%;background: #fff;">
            <div class="exportTable">
                <div class="layui-form-item">
                    <div class="layui-input-inline">
                        <label class="layui-form-label">自定义表:</label>
                        <div name="table"
                             class="layui-unselect layui-form-checkbox layui-form-checked layui-checkbox-disbaled layui-disabled"
                             lay-skin="primary"><i class="layui-icon layui-icon-ok"
                                                   style="background: #e2e2e2 !important;border-color:#e2e2e2 !important;"></i>
                        </div>
                    </div>
                    <div class="layui-input-inline">
                        <label class="layui-form-label">对应的字段:</label>
                        <div name="field"
                             class="layui-unselect layui-form-checkbox layui-form-checked layui-checkbox-disbaled layui-disabled"
                             lay-skin="primary"><i class="layui-icon layui-icon-ok"
                                                   style="background: #e2e2e2 !important;border-color:#e2e2e2 !important;"></i>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-inline">
                        <label class="layui-form-label">对应的子表:</label>
                        <input type="checkbox" lay-skin="primary" name="subTable" id="subTable" lay-skin="primary"
                               checked>
                    </div>
                    <div class="layui-input-inline">
                        <label class="layui-form-label">对应的流水input type号:</label>
                        <div name="identity" id="identity"
                             class="layui-unselect layui-form-checkbox layui-form-checked layui-checkbox-disbaled layui-disabled"
                             lay-skin="primary"><i class="layui-icon layui-icon-ok"
                                                   style="background: #e2e2e2 !important;border-color:#e2e2e2 !important;"></i>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item" style="border:none;margin-top:20px;">
                    <div class="layui-input-block" style="margin:0">
                        <div class="layui-footer" style="text-align: center;position: absolute;left: 36%;top: 23px;">
                            <button type="button" class="layui-btn layui-btn-sm" id="export">导出</button>
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-danger" id="returnExp">取消
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <script>
            layui.config({
                base: serverPath.formPath + staticPath.formPath //静态资源所在路径
            }).extend({
                index: 'index' //主入口模块
            }).use(['index', 'setter', 'layer', 'jquery', 'form'], function () {
                var $ = layui.$;
                var form = layui.form;
                var setter = layui.setter;

                form.render();
                //关闭弹窗
                var index = parent.layer.getFrameIndex(window.name);
                $('#returnExp').click(function () {
                    parent.layer.close(index);
                });
                //导出操作
                var tableIds = "${tableIds}";
                $('#export').click(function () {
                    var subTable = document.getElementById("subTable").checked;
                    var res = {"tableIds": tableIds, "subTable": subTable};
                    var url = serverPath.formPath + setter.formLinkPath + "table/exportXml?tableIds=" + tableIds + "&subTable=" + subTable;
                    window.location.href = url;
                })
            })
        </script>
    </body>
</html>